package com.springboot.mongodb.controller;

import com.springboot.mongodb.impl.HtmServiceImpl;
import com.springboot.mongodb.model.HtmDTO;
import com.springboot.mongodb.model.HtmDepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName springboot_mongodb - HtmController
 * @Description [此类用于: ]
 * @Author liming-jybdd@foxmail.com
 * @Date 2021/9/289:52
 * @Version 1.0
 **/
@RestController
@RequestMapping("/htm")
public class HtmController {

    @Autowired
    private HtmServiceImpl htmService;

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public void saveMode(@RequestBody HtmDTO htmDTO) {
        htmService.saveMode(htmDTO);
    }


    @RequestMapping(value = "/find", method = RequestMethod.POST)
    public List<HtmDepository> findAllHtmMode() {
        return htmService.findAllHtmMode();
    }

    @RequestMapping(value = "/findById", method = RequestMethod.POST)
    public List<HtmDepository> findByIdHtmMode() {
        return htmService.findAllHtmMode();
    }
}